<!DOCTYPE html>
<html lang="en">
  <head>
    <title>RouterRequest Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Class/RouterRequest" class="dashAnchor"></a>

    <a title="RouterRequest Class Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          Kitura Docs
        </a>
         (99% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/Kitura/Kitura/">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">Kitura Reference</a>
      <img class="carat" src="../img/carat.png" />
      RouterRequest Class Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/BodyParser.html">BodyParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/BodyParserMultiValue.html">BodyParserMultiValue</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/ContentType.html">ContentType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Kitura.html">Kitura</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Router.html">Router</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterMiddlewareGenerator.html">RouterMiddlewareGenerator</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterRequest.html">RouterRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/RouterResponse.html">RouterResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer.html">StaticFileServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer/CacheOptions.html">– CacheOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/StaticFileServer/Options.html">– Options</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/JSONPError.html">JSONPError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/LinkParameter.html">LinkParameter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/ParsedBody.html">ParsedBody</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Enums/RouterMethod.html">RouterMethod</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/DecodingError.html">DecodingError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/ResponseHeadersSetter.html">ResponseHeadersSetter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/RouterMiddleware.html">RouterMiddleware</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/TypeSafeMiddleware.html">TypeSafeMiddleware</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/AdditionalCookieAttribute.html">AdditionalCookieAttribute</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/CodableHelpers.html">CodableHelpers</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/HTTPVersion.html">HTTPVersion</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Headers.html">Headers</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MediaType.html">MediaType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/MediaType/TopLevelType.html">– TopLevelType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Part.html">Part</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/Part/HeaderType.html">– HeaderType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/SSLConfig.html">SSLConfig</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/SwaggerDocument.html">SwaggerDocument</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura14HTTPStatusCodea">HTTPStatusCode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura16LifecycleHandlera">LifecycleHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura12RequestErrora">RequestError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura13RouterHandlera">RouterHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura22RouterParameterHandlera">RouterParameterHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura13ServerOptionsa">ServerOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:6Kitura17WrittenDataFiltera">WrittenDataFilter</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>RouterRequest</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">RouterRequest</span></code></pre>

                </div>
              </div>
            <p>The <code>RouterRequest</code> class is used to interact with incoming HTTP requests to the Router.
It contains and allows access to the request&rsquo;s <code><a href="../Structs/Headers.html">Headers</a></code> and <code>Body</code> as well as other properties of the request.
It can also perform content negotiation based on the request’s &ldquo;Accept&rdquo; header.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>

<p>In this example &ldquo;request&rdquo; is an instance of the class <code>RouterRequest</code>.
It is used by the server to read the body of the request as a String and send it back to the user.</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">router</span> <span class="o">=</span> <span class="kt">Router</span><span class="p">()</span>
<span class="n">router</span><span class="o">.</span><span class="nf">post</span><span class="p">(</span><span class="s">"/"</span><span class="p">)</span> <span class="p">{</span> <span class="n">request</span><span class="p">,</span> <span class="n">response</span><span class="p">,</span> <span class="n">next</span> <span class="k">in</span>
    <span class="k">let</span> <span class="nv">body</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="nf">readString</span><span class="p">()</span>
    <span class="n">response</span><span class="o">.</span><span class="nf">send</span><span class="p">(</span><span class="n">body</span><span class="p">)</span>
    <span class="nf">next</span><span class="p">()</span>
<span class="p">}</span>
</code></pre>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Properties"></a>
                <a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Properties"></a>
                  <h3 class="section-name"><p>Properties</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC8hostnameSSvp"></a>
                    <a name="//apple_ref/swift/Property/hostname" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC8hostnameSSvp">hostname</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The hostname of the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">hostname</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC4portSivp"></a>
                    <a name="//apple_ref/swift/Property/port" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC4portSivp">port</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The port of the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">port</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC6domainSSvp"></a>
                    <a name="//apple_ref/swift/Property/domain" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC6domainSSvp">domain</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The domain name of the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">domain</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC10subdomainsSaySSGvp"></a>
                    <a name="//apple_ref/swift/Property/subdomains" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC10subdomainsSaySSGvp">subdomains</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The subdomains string array of request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">subdomains</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC11httpVersionAA11HTTPVersionVvp"></a>
                    <a name="//apple_ref/swift/Property/httpVersion" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC11httpVersionAA11HTTPVersionVvp">httpVersion</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The HTTP version of the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">httpVersion</span><span class="p">:</span> <span class="kt"><a href="../Structs/HTTPVersion.html">HTTPVersion</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC6methodAA0B6MethodOvp"></a>
                    <a name="//apple_ref/swift/Property/method" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC6methodAA0B6MethodOvp">method</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The method of the request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">method</span><span class="p">:</span> <span class="kt"><a href="../Enums/RouterMethod.html">RouterMethod</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC5routeSSSgvp"></a>
                    <a name="//apple_ref/swift/Property/route" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC5routeSSSgvp">route</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The router as a String.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">route</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC13remoteAddressSSvp"></a>
                    <a name="//apple_ref/swift/Property/remoteAddress" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC13remoteAddressSSvp">remoteAddress</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>IP address string of server.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">remoteAddress</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/URL"></a>
                <a name="//apple_ref/swift/Section/URL" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/URL"></a>
                  <h3 class="section-name"><p>URL</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC9parsedURL0A3Net9URLParserCvp"></a>
                    <a name="//apple_ref/swift/Property/parsedURL" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC9parsedURL0A3Net9URLParserCvp">parsedURL</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The parsed URL.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">private(set)</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">parsedURL</span><span class="p">:</span> <span class="kt">URLParser</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC11matchedPathSSvp"></a>
                    <a name="//apple_ref/swift/Property/matchedPath" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC11matchedPathSSvp">matchedPath</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The currently matched section of the URL.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">matchedPath</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC11originalURLSSvp"></a>
                    <a name="//apple_ref/swift/Property/originalURL" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC11originalURLSSvp">originalURL</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The original URL as a string.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">originalURL</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC3urlSSvp"></a>
                    <a name="//apple_ref/swift/Property/url" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC3urlSSvp">url</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The URL.
This contains just the path and query parameters starting with &lsquo;/&rsquo;
Use &lsquo;urlURL&rsquo; for the full URL</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@available</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">deprecated</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="s">"This contains just the path and query parameters starting with '/'. use 'urlURL' instead"</span><span class="p">)</span>
<span class="kd">public</span> <span class="k">var</span> <span class="nv">url</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC13urlComponents10Foundation13URLComponentsVvp"></a>
                    <a name="//apple_ref/swift/Property/urlComponents" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC13urlComponents10Foundation13URLComponentsVvp">urlComponents</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The URL from the request as URLComponents
URLComponents has a memory leak on linux as of swift 3.0.1. Use &lsquo;urlURL&rsquo; instead</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@available</span><span class="p">(</span><span class="o">*</span><span class="p">,</span> <span class="n">deprecated</span><span class="p">,</span> <span class="nv">message</span><span class="p">:</span> <span class="s">"URLComponents has a memory leak on linux as of swift 3.0.1. use 'urlURL' instead"</span><span class="p">)</span>
<span class="kd">public</span> <span class="k">var</span> <span class="nv">urlComponents</span><span class="p">:</span> <span class="kt">URLComponents</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC6urlURL10Foundation0E0Vvp"></a>
                    <a name="//apple_ref/swift/Property/urlURL" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC6urlURL10Foundation0E0Vvp">urlURL</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The URL from the request</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">urlURL</span><span class="p">:</span> <span class="kt">URL</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC10parametersSDyS2SGvp"></a>
                    <a name="//apple_ref/swift/Property/parameters" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC10parametersSDyS2SGvp">parameters</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>List of URL parameters.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">String</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Headers"></a>
                <a name="//apple_ref/swift/Section/Headers" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Headers"></a>
                  <h3 class="section-name"><p>Headers</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC7headersAA7HeadersVvp"></a>
                    <a name="//apple_ref/swift/Property/headers" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC7headersAA7HeadersVvp">headers</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>List of HTTP headers with simple String values.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">headers</span><span class="p">:</span> <span class="kt"><a href="../Structs/Headers.html">Headers</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC7cookiesSDySSSo12NSHTTPCookieCGvp"></a>
                    <a name="//apple_ref/swift/Property/cookies" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC7cookiesSDySSSo12NSHTTPCookieCGvp">cookies</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Parsed Cookies, used to do a lazy parsing of the appropriate headers.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">cookies</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">HTTPCookie</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Query%20parameters"></a>
                <a name="//apple_ref/swift/Section/Query parameters" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Query%20parameters"></a>
                  <h3 class="section-name"><p>Query parameters</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC15queryParametersSDyS2SGvp"></a>
                    <a name="//apple_ref/swift/Property/queryParameters" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC15queryParametersSDyS2SGvp">queryParameters</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>List of query parameters and comma-separated values.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">queryParameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">String</span><span class="p">]</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC26queryParametersMultiValuesSDySSSaySSGGvp"></a>
                    <a name="//apple_ref/swift/Property/queryParametersMultiValues" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC26queryParametersMultiValuesSDySSSaySSGGvp">queryParametersMultiValues</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Query parameters with values as an array.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">lazy</span> <span class="k">var</span> <span class="nv">queryParametersMultiValues</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">]]</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC18getQueryParameters2asxSgxm_t0A9Contracts0E6ParamsRzlF"></a>
                    <a name="//apple_ref/swift/Method/getQueryParameters(as:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC18getQueryParameters2asxSgxm_t0A9Contracts0E6ParamsRzlF">getQueryParameters(as:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Convert query parameters into a QueryParam type</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">getQueryParameters</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="k">as</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">T</span><span class="o">.</span><span class="k">Type</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">T</span><span class="p">?</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">QueryParams</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The QueryParam type describing the expected query parameters</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The route&rsquo;s Query parameters as a QueryParam object</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Shared%20dictionary"></a>
                <a name="//apple_ref/swift/Section/Shared dictionary" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Shared%20dictionary"></a>
                  <h3 class="section-name"><p>Shared dictionary</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC8userInfoSDySSypGvp"></a>
                    <a name="//apple_ref/swift/Property/userInfo" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC8userInfoSDySSypGvp">userInfo</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>User info.
Can be used by middlewares and handlers to store and pass information on to subsequent handlers.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">userInfo</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">Any</span><span class="p">]</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Request%20Body"></a>
                <a name="//apple_ref/swift/Section/Request Body" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Request%20Body"></a>
                  <h3 class="section-name"><p>Request Body</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC4bodyAA10ParsedBodyOSgvp"></a>
                    <a name="//apple_ref/swift/Property/body" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC4bodyAA10ParsedBodyOSgvp">body</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Body of the message.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">internal(set)</span> <span class="k">var</span> <span class="nv">body</span><span class="p">:</span> <span class="kt"><a href="../Enums/ParsedBody.html">ParsedBody</a></span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC4read4intoSi10Foundation4DataVz_tKF"></a>
                    <a name="//apple_ref/swift/Method/read(into:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC4read4intoSi10Foundation4DataVz_tKF">read(into:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read the body of the request as Data.</p>
<div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    Socket.Error if an error occurred while reading from a socket.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">read</span><span class="p">(</span><span class="n">into</span> <span class="nv">data</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">Data</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>into</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Data object in which the body of the request is returned.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>the number of bytes read.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC4read2asxxm_tKSeRzlF"></a>
                    <a name="//apple_ref/swift/Method/read(as:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC4read2asxxm_tKSeRzlF">read(as:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read the body of the request as a Codable object using a <code>BodyDecoder</code>
that was selected based on the Content-Type header.
Defaults to <code>JSONDecoder()</code> if no decoder is provided.</p>
<h3 id='usage-example' class='heading'>Usage Example:</h3>

<p>The example below defines a <code>User</code> struct and then decodes a <code>User</code> from the body of a request.</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">User</span><span class="p">:</span> <span class="kt">Codable</span> <span class="p">{</span>
   <span class="k">let</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span>
<span class="p">}</span>
<span class="k">let</span> <span class="nv">router</span> <span class="o">=</span> <span class="kt">Router</span><span class="p">()</span>
<span class="n">router</span><span class="o">.</span><span class="nf">post</span><span class="p">(</span><span class="s">"/example"</span><span class="p">)</span> <span class="p">{</span> <span class="n">request</span><span class="p">,</span> <span class="n">response</span><span class="p">,</span> <span class="n">next</span> <span class="k">in</span>
    <span class="k">let</span> <span class="nv">user</span> <span class="o">=</span> <span class="k">try</span> <span class="n">request</span><span class="o">.</span><span class="nf">read</span><span class="p">(</span><span class="nv">as</span><span class="p">:</span> <span class="kt">User</span><span class="o">.</span><span class="k">self</span><span class="p">)</span>
    <span class="nf">print</span><span class="p">(</span><span class="n">user</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
    <span class="nf">next</span><span class="p">()</span>
<span class="p">}</span>
</code></pre>
<div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    Socket.Error if an error occurred while reading from a socket.

</div><div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    <code>DecodingError.dataCorrupted</code> if values requested from the payload are corrupted, or if the given data is not valid JSON.

</div><div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    An error if any value throws an error during decoding.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">read</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="k">as</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">T</span><span class="o">.</span><span class="k">Type</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">T</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">Decodable</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>as</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Codable object to which the body of the request will be converted.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The instantiated Codable object</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC10readStringSSSgyKF"></a>
                    <a name="//apple_ref/swift/Method/readString()" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC10readStringSSSgyKF">readString()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read the body of the request as String.</p>
<div class="aside aside-throws">
    <p class="aside-title">Throws</p>
    Socket.Error if an error occurred while reading from a socket.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">readString</span><span class="p">()</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>the String with the request body.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Accepts"></a>
                <a name="//apple_ref/swift/Section/Accepts" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Accepts"></a>
                  <h3 class="section-name"><p>Accepts</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC7accepts6header5typesSSSgSS_SaySSGtF"></a>
                    <a name="//apple_ref/swift/Method/accepts(header:types:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC7accepts6header5typesSSSgSS_SaySSGtF">accepts(header:<wbr>types:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if passed in types are acceptable based on the request&rsquo;s header field
specified in the first parameter.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">accepts</span><span class="p">(</span><span class="nv">header</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Accept"</span><span class="p">,</span> <span class="nv">types</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>header</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>name of request&rsquo;s header field to be checked.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>types</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>array of content/mime type strings.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>most acceptable type or nil if there are none.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC7accepts6header5typesSSSgSS_SSdtF"></a>
                    <a name="//apple_ref/swift/Method/accepts(header:types:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC7accepts6header5typesSSSgSS_SSdtF">accepts(header:<wbr>types:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if passed in types are acceptable based on the request&rsquo;s header field
specified in the first parameter.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">accepts</span><span class="p">(</span><span class="nv">header</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Accept"</span><span class="p">,</span> <span class="nv">types</span><span class="p">:</span> <span class="kt">String</span><span class="o">...</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>header</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>name of request&rsquo;s header field to be checked.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>types</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>content/mime type strings.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>most acceptable type or nil if there are none.</p>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6Kitura13RouterRequestC7accepts6header4typeSSSgSS_SStF"></a>
                    <a name="//apple_ref/swift/Method/accepts(header:type:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6Kitura13RouterRequestC7accepts6header4typeSSSgSS_SStF">accepts(header:<wbr>type:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Check if passed in types are acceptable based on the request&rsquo;s header field
specified in the first parameter.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">accepts</span><span class="p">(</span><span class="nv">header</span><span class="p">:</span> <span class="kt">String</span> <span class="o">=</span> <span class="s">"Accept"</span><span class="p">,</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">String</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>header</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>name of request&rsquo;s header field to be checked.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>type</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>content/mime type string.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>most acceptable type or nil if there are none.</p>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2021 <a class="link" href="" target="_blank" rel="external">IBM &amp; Kitura project authors</a>. All rights reserved. (Last updated: 2021-01-25)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.6</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
